<me:UIFUNC x:Class="WPFExcelReport.TFUNCTIONS"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    x:Name="TV"
                    Loaded="Window_Loaded"
                    >
    <me:UIFUNC.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
    </me:UIFUNC.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition  Width="1*" />
            <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.ColumnSpan="2">
            <WrapPanel  Margin="0,0,-0.2,0">
                <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=下载}}" Click="QueryCommand"></Button>
                <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=编辑}}" Click="EditCommand"></Button>
                <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=复制}}" Click="CopyCommand"></Button>
                <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=保存}}" Click="SaveCommand"></Button>
                <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=取消}}" Click="DeleteCommand"></Button>
                <Button  Margin="10,0,0,0"  Content="{Binding Source={Localization:Translate Word=重置流水号}}" Click="ResetSeq"/>
             </WrapPanel>
            <WrapPanel  Margin="0,0,-0.2,0">
                        <TextBlock>ROWNID</TextBlock>
                <TextBox   HorizontalAlignment="Left" Margin="3" Text="{Binding Path=ROWNID, Source={StaticResource ResourceKey=vwMaster}}" VerticalAlignment="Center" Width="60" />
                <TextBlock>TYPE</TextBlock>
                <TextBox Name="txtType"  HorizontalAlignment="Left" Margin="3" KeyDown="txtFunctionType_KeyDown"
                                   Text="{Binding Path=TYPE, Source={StaticResource ResourceKey=vwMaster}}" VerticalAlignment="Center" Width="120" />
                <TextBlock Text="{Binding Source={Localization:Translate Word=回车FULLNAME}}"></TextBlock>
                <TextBox   HorizontalAlignment="Left" Margin="3" Text="{Binding Path=FULLNAME, Source={StaticResource ResourceKey=vwMaster}}" VerticalAlignment="Center" Width="120" />
                <TextBlock>FILENAME</TextBlock>
                <TextBox   HorizontalAlignment="Left" Margin="3" Text="{Binding Path=FILENAME, Source={StaticResource ResourceKey=vwMaster}}" VerticalAlignment="Center" Width="120" />
                <TextBlock Text="{Binding Source={Localization:Translate Word=描述}}"></TextBlock>
                <TextBox   HorizontalAlignment="Left" Margin="3" Text="{Binding Path=DESCRIPTION, Converter={StaticResource ResourceKey=gb2312}, Source={StaticResource ResourceKey=vwMaster}}" VerticalAlignment="Center" Width="120" />
            </WrapPanel>
        </StackPanel >        
        <DataGrid  Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="1"
                              AutoGenerateColumns="False"
                              EnableRowVirtualization="True"  
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}"  
                              HeadersVisibility="Column"                           
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="0,0,0,0" 
                              >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=ROWNID}" Header="{Binding Source={Localization:Translate Word=ROWNID}}"   Width="Auto"  MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=TYPE}" Header="{Binding Source={Localization:Translate Word=TYPE}}"   Width="Auto"  MinWidth="40"/>
                <!--DataGridTextColumn Binding="{Binding Path=NAMESPACE}" Header="{Binding Source={Localization:Translate Word=NAMESPACE}}"  Width="Auto" MinWidth="20"/>
                            <DataGridTextColumn Binding="{Binding Path=FULLNAME}" Header="{Binding Source={Localization:Translate Word=FULLNAME}}"  Width="Auto" MinWidth="20"/>
                            <DataGridTextColumn Binding="{Binding Path=FILENAME}" Header="{Binding Source={Localization:Translate Word=FILENAME}}"  Width="Auto" MinWidth="40"/-->
                <DataGridTextColumn Binding="{Binding Path=DESCRIPTION, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=描述}}"  Width="Auto" MinWidth="40"/>
            </DataGrid.Columns>
        </DataGrid> 
    </Grid>
</me:UIFUNC>
